
angular.module('myApp')
.controller('DialogCtrl', ['$scope', function($scope) {
  $scope.dialogVisible = false
  $scope.onClick = () => {
    $scope.dialogVisible = true
  }
  $scope.confirm = () => {
    $scope.dialogVisible = false
  }
  $scope.cancel = () => {
    $scope.dialogVisible = false
  }
}])
.factory('zIndexManager', function() {
  let baseZIndex = 2000;
  return {
    next: function() {
      return baseZIndex += 10;
    }
  };
})
.directive('elDialog', ['$document', '$compile', elDialog]);